<?php
class JobProvider extends AppModel {
	var $name = 'JobProvider';
	var $displayField = 'name';
	var $validate = array(
		'name' => array(
			'notempty' => array(
				'rule' => array('notempty'),
				'message' => 'Name Required',
			),
		),
		'tel' => array(
			'phone' => array(
				'rule' => array('notempty'),
				'message' => 'Required',
			),
		),
		'fax' => array(
			'alphanumeric' => array(
				'rule' => array('alphanumeric'),
				'message' => 'Required',
			),
		),
		'email' => array(
			'email' => array(
				'rule' => array('email'),
				'message' => 'Required',
			),
		),
		'web' => array(
			'url' => array(
				'rule' => array('url'),
				'message' => 'Required',
			),
		),
	);
	//The Associations below have been created with all possible keys, those that are not needed can be removed

	var $belongsTo = array(
		'JobLocation' => array(
			'className' => 'JobLocation',
			'foreignKey' => 'job_location_id',
		),
		'User' => array(
			'className' => 'User',
			'foreignKey' => 'user_id',
		)
	);

	var $hasMany = array(
		'ContactPerson' => array(
			'className' => 'ContactPerson',
			'foreignKey' => 'job_provider_id',
			'dependent' => true,
		),
		'JobDetail' => array(
			'className' => 'JobDetail',
			'foreignKey' => 'job_provider_id',
			'dependent' => true,
		)
	);
}
?>